
package com.zjxd.business.web.utils;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;

public class Utils {

	public static String	private_key	= "MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBAKUMOBn1uygpg7XBWAOKn7hEeOeLEVagA0WtjdU53mJph3s-6FzfxI2MbwbWq2aP2vPbaLHFDkNh2xUrgYKIyBR2ogVKCVmYO6VNXMoqm3EFP4z8jYSGXxAWjfq-tmumbYeIzGg-vTmFb_Kgt7qx7oH3D1p1v8wEaJsZoz5_2ElnAgMBAAECgYAQ3uXhKXAfE9dFveSsQABBiqY9LMbx7ttGxQ3JbOfhcV4K6AxCahEiUueKcGkGy8-au6PBAB6MHrWRPWg4mpiw7MFHgTg4NEiECEBQ6V1P06S1TwtXwxKFjXhsya6VTEEHG0X5nt1n0by8-B0m5pL3dJCz9EyscO0XOHOJ5gUPkQJBANN6vyUjgVXQjPa2HzX-Zstl50ww5z0vdkrG_aaiKhtFzCVm87hoj1SbEnjGfwtTfPAuUHnGUO8VLhwdAjoqQ88CQQDHyyDna8VcuIGDncu3upxcTKMPwkXVuoZ_dqbNIEGWh93FG6quVyksL69SxrzdctrbFDoO567Dyy9UUa1KMM7pAkBWbbPw2bHiAHmb2pKm3nHkbqE44kOfHeaaaPkBQQU0YDIulwTEOPda_IVwFq-VUWmeP09kdUhebamKk9B1NRDBAkEAguPRx6r0Hp2Fw-tBxjlMLK_MeAuHYtETQjhCaMpEDdEu-e35MMRLZfZLfwhSPSX8uWAT9SXVedIITM5BoAQ_2QJABmIwYO8UQcw-vDOfWKImhN3WoUPUdK9GQ6XJRkzCGSAAAcU05b4Y12AZk0V3OtmX8Rdr2X6aOZpqKV5aJjaJyA";

	public static String	public_key	= "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQClDDgZ9bsoKYO1wVgDip-4RHjnixFWoANFrY3VOd5iaYd7Puhc38SNjG8G1qtmj9rz22ixxQ5DYdsVK4GCiMgUdqIFSglZmDulTVzKKptxBT-M_I2Ehl8QFo36vrZrpm2HiMxoPr05hW_yoLe6se6B9w9adb_MBGibGaM-f9hJZwIDAQAB";

	public static List<Map.Entry<String, String>> sortMap(final Map<String, String> map) {

		final List<Map.Entry<String, String>> infos = new ArrayList<Map.Entry<String, String>>(map.entrySet());
		// 重写集合的排序方法：按字母顺序
		Collections.sort(infos, new Comparator<Map.Entry<String, String>>() {

			@Override
			public int compare(final Entry<String, String> o1, final Entry<String, String> o2) {

				return (o1.getKey().toString().compareTo(o2.getKey()));
			}
		});
		return infos;
	}

	public static List<Map.Entry<String, String[]>> sortMap2(final Map<String, String[]> map) {

		final List<Map.Entry<String, String[]>> infos = new ArrayList<Map.Entry<String, String[]>>(map.entrySet());
		// 重写集合的排序方法：按字母顺序
		Collections.sort(infos, new Comparator<Map.Entry<String, String[]>>() {

			@Override
			public int compare(final Entry<String, String[]> o1, final Entry<String, String[]> o2) {

				return (o1.getKey().toString().compareTo(o2.getKey()));
			}
		});
		return infos;
	}

}
